#pragma once
#include <streams.h>

class CMiiShowPinIn : public CBaseInputPin
{
public:
    CCritSec m_tLock;
	CMediaType m_tType;

public:
	CMiiShowPinIn(CBaseFilter *pFilter, CCritSec *pLock, HRESULT *phr);
	virtual ~CMiiShowPinIn();

public:
	BOOL Check(const CMediaType* pmt);
	BOOL IsMatch(const CMediaType* pmt1, const CMediaType* pmt2);
    HRESULT CheckMediaType(const CMediaType *pmt);
	HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
	HRESULT CompleteConnect(IPin *pReceivePin);
	CMediaType *MediaType();

    HRESULT SetMediaType(const CMediaType *);
    HRESULT CheckConnect(IPin *);
	STDMETHODIMP EndOfStream(void);

public:
    STDMETHODIMP Receive(IMediaSample *pSample);
public:
	VIDEOINFO m_vInfo;
	char *m_pBuffer[2];
	int m_nBufIndex;
public:
	// get picture from the pin
	void GetPicture(char ** pBuffer, int* width, int* height, int* bitCount, int* color);
protected:
	int mOutWidth, mOutHeight;
	int mTimeStamp;
};

